{% extends 'student_management/base.html' %}

{% block content %}
<div class="card">
    <div class="card-header">
        <h3>{{ teacher.name }} 的评价</h3>
        <p class="mb-0">平均评分：{{ avg_rating|default:'暂无评分'|floatformat:1 }}</p>
    </div>
    <div class="card-body">
        {% if ratings %}
        <div class="list-group">
            {% for rating in ratings %}
            <div class="list-group-item">
                <div class="d-flex justify-content-between">
                    <h6 class="mb-1">{{ rating.student.name }} - {{ rating.course.name }}</h6>
                    <small>{{ rating.rating }}分</small>
                </div>
                <p class="mb-1">{{ rating.comment|default:'无评价内容' }}</p>
                <small class="text-muted">{{ rating.created_at|date:"Y-m-d H:i" }}</small>
            </div>
            {% endfor %}
        </div>
        {% else %}
        <p class="text-center">暂无评价</p>
        {% endif %}
        <div class="mt-3">
            <a href="{% url 'teacher-list' %}" class="btn btn-secondary">返回</a>
        </div>
    </div>
</div>
{% endblock %} 